package ytdp.careagle.com.ytdp.activity;

import android.animation.ValueAnimator;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.RequiresApi;
import android.support.constraint.ConstraintLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
import android.widget.FrameLayout;
import android.widget.HorizontalScrollView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;

import com.umeng.analytics.dplus.UMADplus;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.OnClick;
import ytdp.careagle.com.ytdp.R;
import ytdp.careagle.com.ytdp.adapter.FragmentBannerAdapter;
import ytdp.careagle.com.ytdp.adapter.base.CommonAdapter;
import ytdp.careagle.com.ytdp.adapter.base.MultiItemTypeAdapter;
import ytdp.careagle.com.ytdp.adapter.base.ViewHolder;
import ytdp.careagle.com.ytdp.app.APP;
import ytdp.careagle.com.ytdp.app.G;
import ytdp.careagle.com.ytdp.app.Operation;
import ytdp.careagle.com.ytdp.entity.SellCarProgramEntity;
import ytdp.careagle.com.ytdp.fragment.FragmentVideoViewpagerFragment;
import ytdp.careagle.com.ytdp.mvp.presenter.FinancialProgramPresenter;
import ytdp.careagle.com.ytdp.mvp.view.IFinancialProgramView;
import ytdp.careagle.com.ytdp.myview.MyLinearManager;
import ytdp.careagle.com.ytdp.myview.MyPayFirstView;
import ytdp.careagle.com.ytdp.myview.MyPayMonthView;
import ytdp.careagle.com.ytdp.myview.MyTableView;
import ytdp.careagle.com.ytdp.myview.NumAnim;
import ytdp.careagle.com.ytdp.utils.Utils;

public class FinancialProgramActivity extends BaseActivity implements IFinancialProgramView, MyTableView.FirstOnClickListener {
    @Bind(R.id.viewPager)
    ViewPager viewPager;
    @Bind(R.id.tv_title)
    TextView tvTitle;
    @Bind(R.id.tv_back_homepage)
    TextView tvBackHomepage;
    @Bind(R.id.tv_lastPage)
    TextView tvLastPage;
    @Bind(R.id.tv_buy_car_price)
    TextView tvBuyCarPrice;
    @Bind(R.id.line_tv_buy_car_price)
    View lineTvBuyCarPrice;
    @Bind(R.id.tv_car_type)
    TextView tvCarType;
    @Bind(R.id.tv_car_price)
    TextView tvCarPrice;
    @Bind(R.id.line_eff_top)
    View lineEffTop;
    @Bind(R.id.tv_change_price_title)
    TextView tvChangePriceTitle;
    @Bind(R.id.tv_change_price)
    TextView tvChangePrice;
    @Bind(R.id.ll_change_price)
    LinearLayout llChangePrice;
    @Bind(R.id.tv_change_price_all)
    TextView tvChangePriceAll;
    @Bind(R.id.line_eff_bottom)
    View lineEffBottom;
    @Bind(R.id.myPayFirstView)
    MyPayFirstView myPayFirstView;
    @Bind(R.id.tv_first_bottom)
    TextView tvFirstBottom;
    @Bind(R.id.ll_first_bottom)
    LinearLayout llFirstBottom;
    @Bind(R.id.myPayMonthView)
    MyPayMonthView myPayMonthView;
    @Bind(R.id.ll_anim)
    LinearLayout llAnim;
    @Bind(R.id.tv_most_plan)
    TextView tvMostPlan;
    @Bind(R.id.ll_pay_way)
    LinearLayout llPayWay;
    @Bind(R.id.ll_pay_way_value)
    LinearLayout llPayWayValue;
    @Bind(R.id.tv_know_more)
    TextView tvKnowMore;
    @Bind(R.id.tv_first_sell)
    TextView tvFirstSell;
    @Bind(R.id.tv_month_sell)
    TextView tvMonthSell;
    @Bind(R.id.tv_my_car_sell_price)
    TextView tvMyCarSellPrice;
    @Bind(R.id.line_tv_know_more)
    View lineTvKnowMore;
    @Bind(R.id.ll_buy_car_price)
    LinearLayout llBuyCarPrice;
    @Bind(R.id.ll_car_config_content)
    LinearLayout llCarConfigContent;
    @Bind(R.id.ll_top)
    LinearLayout llTop;
    @Bind(R.id.scrollview)
    ScrollView scrollview;
    @Bind(R.id.myTableViewTop)
    MyTableView myTableViewTop;
    @Bind(R.id.iv_open_close)
    ImageView ivOpenClose;
    @Bind(R.id.ll_viewGroup)
    ConstraintLayout llViewGroup;
    @Bind(R.id.layout_center)
    ConstraintLayout layoutCenter;
    @Bind(R.id.hScrollView)
    HorizontalScrollView hScrollView;
    @Bind(R.id.scrollView_top)
    HorizontalScrollView scrollViewTop;
    @Bind(R.id.ll_car_config_content_left)
    LinearLayout llCarConfigContentLeft;
    @Bind(R.id.fl_top)
    FrameLayout flTop;
    @Bind(R.id.myTableViewTop_left)
    MyTableView myTableViewTopLeft;
    @Bind(R.id.tv_first_key)
    TextView tvFirstKey;
    @Bind(R.id.tv_month_key)
    TextView tvMonthKey;
    @Bind(R.id.tv_video)
    TextView tvVideo;
    @Bind(R.id.tv_viewPager_index)
    TextView tvViewPagerIndex;
    @Bind(R.id.tv_image)
    TextView tvImage;
    @Bind(R.id.tv_change_price_wy)
    TextView tvChangePriceWy;
    @Bind(R.id.layout_bottom)
    ConstraintLayout layoutBottom;
    @Bind(R.id.ll_selectCarMode)
    LinearLayout llSelectCarMode;
    @Bind(R.id.ll_video_or_pic)
    LinearLayout llVideoOrPic;
    @Bind(R.id.recyclerViewCarMode)
    RecyclerView recyclerView;
    @Bind(R.id.rl_gen)
    RelativeLayout rlGen;
    @Bind(R.id.view_close_ll)
    View viewCloseLl;
    @Bind(R.id.btn_to_top)
    ImageView btnToTop;
    @Bind(R.id.tv_first_sell_wy)
    TextView tvFirstSellWy;
    @Bind(R.id.tv_month_sell_wy)
    TextView tvMonthSellWy;
    @Bind(R.id.tv_my_car_sell_price_wy)
    TextView tvMyCarSellPriceWy;
    private boolean isOpenMostPlan = false;//是否开启了更多方案布局
    private boolean isFirst = true;//第一次进入布局折叠
    private ValueAnimator valueAnimator;
    private float yOpen;
    private List<SellCarProgramEntity> sellCarProgramEntityList;
    private List<List<String>> carConfigs;
    private FinancialProgramPresenter presenter;
    private double myCarSellPrice;
    private double firstScal = 0.3;
    private int monthNumber = 36;
    private Drawable iconUp;
    private Drawable iconDown;
    private String valuationQueryRecordIds;
    private ArrayList<FragmentVideoViewpagerFragment> viewpagerList;
    private CommonAdapter<SellCarProgramEntity> carModeadapter;
    private Handler handler;
    private SellCarProgramEntity.MultimediaBean currMultimedia;
    private boolean allCarConfig = true;

    @OnClick({R.id.tv_most_plan, R.id.iv_open_close, R.id.tv_back_homepage,
            R.id.tv_lastPage, R.id.tv_know_more, R.id.tv_car_price, R.id.ll_selectCarMode,
            R.id.rl_gen, R.id.scrollview, R.id.view_close_ll, R.id.tv_video, R.id.tv_image, R.id.btn_to_top})
    public void onClick(View view) {
        APP.getInstance().resetCountDown();
        if (view.getId() != R.id.ll_selectCarMode) {
            onSelectedLLColse();
        }
        switch (view.getId()) {
            case R.id.view_close_ll:
                onSelectedLLColse();
                break;
            case R.id.tv_most_plan:
            case R.id.iv_open_close:
                animLayout();
                break;
            case R.id.tv_back_homepage:
                APP.getInstance().backHomeActivity();
                break;
            case R.id.tv_lastPage:
                finish();
                break;
            case R.id.btn_to_top:
                scrollview.scrollTo(0, 0);
                break;
            case R.id.tv_car_price:// 切换车型
                selectCarInfo();
                break;
            case R.id.tv_video:// 视频
                if ("SOURCE_IMAGE".equals(currMultimedia.getSourceType())) {
                    viewPager.setCurrentItem(0);
                }
                break;
            case R.id.tv_image:// 图片
                if ("SOURCE_VIDEO".equals(currMultimedia.getSourceType())) {
                    for (int i = 0; i < sellCarProgramEntityList.size(); i++) {
                        SellCarProgramEntity sellCarProgramEntity = sellCarProgramEntityList.get(i);
                        if ("SOURCE_IMAGE".equals(sellCarProgramEntity.getMultimedia().getSourceType())) {
                            viewPager.setCurrentItem(i);
                            break;
                        }
                    }
                }
                break;
            case R.id.tv_know_more:
                Operation operation = getOperation();
                operation.addParameter("valuationQueryRecordIds", valuationQueryRecordIds + "");
                operation.forward(InputPhoneActivity.class);
                break;
        }
    }

    private void selectCarInfo() {
        if (sellCarProgramEntityList.size() <= 1) {
            showMessage("只存在一种车型，没有更多选择项");
            return;
        }
        if (llSelectCarMode.getVisibility() == View.GONE) {
            llSelectCarMode.setVisibility(View.VISIBLE);
        }
        llSelectCarMode.animate().translationYBy(llSelectCarMode.getTranslationY()).translationY(G.height / 4).setDuration(300).start();
    }

    private void animLayout() {
        if (valueAnimator != null && valueAnimator.isRunning()) {
            valueAnimator.cancel();
        }
        if (isOpenMostPlan) {
            isOpenMostPlan = false;
            valueAnimator = ValueAnimator.ofFloat(yOpen, 1);
            ivOpenClose.setImageResource(R.drawable.icon_bottom);
        } else {
            isOpenMostPlan = true;
            valueAnimator = ValueAnimator.ofFloat(1, yOpen);
            ivOpenClose.setImageResource(R.drawable.icon_up);
        }
        valueAnimator.setDuration(500);
        valueAnimator.setInterpolator(new AccelerateInterpolator());
        valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                float value = (Float) animation.getAnimatedValue();
                ViewGroup.LayoutParams layoutParams = llAnim.getLayoutParams();
                layoutParams.height = (int) value;
                llAnim.setLayoutParams(layoutParams);
            }
        });
        valueAnimator.start();
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_financial_program;
    }

    @RequiresApi(api = Build.VERSION_CODES.M)
    @Override
    public void initView() {
        UMADplus.track(this, "金融方案页面", null);
        Intent intent = getIntent();
        sellCarProgramEntityList = (List<SellCarProgramEntity>) intent.getSerializableExtra("data");
        if (sellCarProgramEntityList == null || sellCarProgramEntityList.size() == 0) {
            finish();
            return;
        }
        myCarSellPrice = intent.getDoubleExtra("sellPrice", 0);
        valuationQueryRecordIds = intent.getStringExtra("valuationQueryRecordId");
        presenter = new FinancialProgramPresenter(this);
        presenter.getVehicleModelParams(getWContext().get());
        initScrollListener();
        setCarInfo(sellCarProgramEntityList.get(0));
        myPayFirstView.setCallBack(new MyPayFirstView.CallBack() {
            @Override
            public void call(int selected) {
                APP.getInstance().resetCountDown();
                switch (selected) {
                    case 0:
                        firstScal = 0.3;
                        break;
                    case 1:
                        firstScal = 0.35;
                        break;
                    case 2:
                        firstScal = 0.4;
                        break;
                    case 3:
                        firstScal = 0.45;
                        break;
                    case 4:
                        firstScal = 0.5;
                        break;
                }
                setCarInfo(sellCarProgramEntityList.get(0));
                tvFirstKey.setText("(" + (int) (firstScal * 100) + "%" + ")");
            }
        });
        myPayMonthView.setCallBack(new MyPayMonthView.CallBack() {
            @Override
            public void call(int selected) {
                APP.getInstance().resetCountDown();
                switch (selected) {
                    case 0:
                        monthNumber = 12;
                        break;
                    case 1:
                        monthNumber = 24;
                        break;
                    case 2:
                        monthNumber = 36;
                        break;
                }
                setCarInfo(sellCarProgramEntityList.get(0));
                tvMonthKey.setText("(" + monthNumber + "个月)");
            }
        });
        if (myCarSellPrice == 0) {
            layoutCenter.setVisibility(View.GONE);
        }
        tvTitle.setText("" + sellCarProgramEntityList.get(0).getSeriesName());
        initViewPager();
        initCarMode();
        checkVideoPicFlag();
        myTableViewTopLeft.setFirstOnClickListener(this);
    }

    private void checkVideoPicFlag() {
        boolean isPic = false;
        boolean isVideo = false;
        for (int i = 0; i < sellCarProgramEntityList.size(); i++) {
            if ("SOURCE_IMAGE".equals(sellCarProgramEntityList.get(i).getMultimedia().getSourceType())) {
                isPic = true;
            }
            if ("SOURCE_VIDEO".equals(sellCarProgramEntityList.get(i).getMultimedia().getSourceType())) {
                isVideo = true;
            }
        }
        if (isVideo && isPic) {
            llVideoOrPic.setVisibility(View.VISIBLE);
        } else {
            llVideoOrPic.setVisibility(View.GONE);
        }
    }

    private int indexSelected = 0;

    public void onSelectedLLColse() {
        llSelectCarMode.animate().translationYBy(llSelectCarMode.getTranslationY()).translationY(G.height).setDuration(300).start();
    }

    private void initCarMode() {
        recyclerView.setLayoutManager(new MyLinearManager(this));
        carModeadapter = new CommonAdapter<SellCarProgramEntity>(this, R.layout.item_select_car_mode, sellCarProgramEntityList) {
            @Override
            protected void convert(ViewHolder holder, SellCarProgramEntity data, int position) {
                TextView tvTitle = holder.getView(R.id.tv_title);
                TextView tvPrice = holder.getView(R.id.tv_price);
                ImageView ivRight = holder.getView(R.id.iv_right);
                tvTitle.setText(data.getModelName());
                String price = "总价：" + data.getSellPrice() + "元";
                tvPrice.setText(price);
                if (indexSelected == position) {
                    tvTitle.setTextColor(getResources().getColor(R.color.guestPaint_color_wrong));
                    tvPrice.setTextColor(getResources().getColor(R.color.guestPaint_color_wrong));
                    ivRight.setVisibility(View.VISIBLE);
                } else {
                    tvTitle.setTextColor(getResources().getColor(R.color.text_title));
                    tvPrice.setTextColor(getResources().getColor(R.color.text_title));
                    ivRight.setVisibility(View.INVISIBLE);
                }
            }
        };
        recyclerView.setAdapter(carModeadapter);
        carModeadapter.setOnItemClickListener(new MultiItemTypeAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(View view, RecyclerView.ViewHolder holder, int position) {
                indexSelected = position;
                carModeadapter.notifyDataSetChanged();
                onSelectedLLColse();
                setCarInfo(sellCarProgramEntityList.get(position));
            }

            @Override
            public boolean onItemLongClick(View view, RecyclerView.ViewHolder holder, int position) {
                return false;
            }
        });
    }

    private void initViewPager() {
        viewpagerList = new ArrayList<>();
        for (int i = 0; i < sellCarProgramEntityList.size(); i++) {
            FragmentVideoViewpagerFragment fragment = new FragmentVideoViewpagerFragment();
            Bundle bundle = new Bundle();
            bundle.putSerializable("data", sellCarProgramEntityList.get(i).getMultimedia());
            fragment.setArguments(bundle);
            viewpagerList.add(fragment);
        }
        FragmentBannerAdapter<FragmentVideoViewpagerFragment> bannerAdapter = new FragmentBannerAdapter<>(getSupportFragmentManager(), viewpagerList);
        viewPager.setAdapter(bannerAdapter);
        viewPager.setOffscreenPageLimit(sellCarProgramEntityList.size());
        viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
            @Override
            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {

            }

            @Override
            public void onPageSelected(int position) {
                APP.getInstance().resetCountDown();
                currIndex(position);
            }

            @Override
            public void onPageScrollStateChanged(int state) {

            }
        });
        handler = new Handler();
        handler.postDelayed(runnablePalyDetal, 1000);//1秒后播放视屏
        currIndex(0);
    }

    private Runnable runnablePalyDetal = new Runnable() {
        @Override
        public void run() {
            currIndex(0);//播放第一个视屏
        }
    };

    private void currIndex(int position) {
        currMultimedia = sellCarProgramEntityList.get(position).getMultimedia();
        if (currMultimedia.getSourceType().equals("SOURCE_IMAGE")) {
            tvVideo.setSelected(false);
            tvVideo.setTextColor(getResources().getColor(R.color.text_title));
            tvImage.setSelected(true);
            tvImage.setTextColor(getResources().getColor(R.color.white));
        } else if (currMultimedia.getSourceType().equals("SOURCE_VIDEO")) {
            tvImage.setSelected(false);
            tvImage.setTextColor(getResources().getColor(R.color.text_title));
            tvVideo.setSelected(true);
            tvVideo.setTextColor(getResources().getColor(R.color.white));
        }
        for (int i = 0; i < viewpagerList.size(); i++) {
            if (i != position) {
                viewpagerList.get(i).stopVideo();
            } else {
                viewpagerList.get(i).startVideo();
            }
        }
        tvViewPagerIndex.setText((position + 1) + "/" + sellCarProgramEntityList.size());
    }

    @RequiresApi(api = Build.VERSION_CODES.M)
    private void initScrollListener() {
        scrollview.setOnScrollChangeListener(new View.OnScrollChangeListener() {
            @Override
            public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
                float y = llBuyCarPrice.getY() + llViewGroup.getHeight() + layoutCenter.getHeight();

                llTop.setVisibility((scrollY - y) > 0 ? View.VISIBLE : View.GONE);
                btnToTop.setVisibility((scrollY - y) > 0 ? View.VISIBLE : View.GONE);
            }
        });
        hScrollView.setOnScrollChangeListener(new View.OnScrollChangeListener() {
            @Override
            public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
                scrollViewTop.scrollTo(scrollX, 0);
            }
        });
    }

    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        super.onWindowFocusChanged(hasFocus);
        if (hasFocus && isFirst) {
            isFirst = false;
            yOpen = llAnim.getHeight();
            ViewGroup.LayoutParams layoutParams = llAnim.getLayoutParams();
            layoutParams.height = 1;
            llAnim.setLayoutParams(layoutParams);
            llSelectCarMode.setTranslationY(G.height);
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (valueAnimator != null && valueAnimator.isRunning()) {
            valueAnimator.cancel();
            valueAnimator = null;
        }
        if (handler != null) {
            handler.removeCallbacks(runnablePalyDetal);
        }
    }

    @Override
    public String modeCodes() {
        String modelCodes = "";
        for (SellCarProgramEntity sellCarProgramEntity : sellCarProgramEntityList) {
            modelCodes += sellCarProgramEntity.getModelCode() + ",";
        }
        if (modelCodes.endsWith(",")) {
            modelCodes = modelCodes.substring(0, modelCodes.length() - 1);
        }
        return modelCodes;
    }

    @Override
    public void setCarConfig(List<List<String>> data) {
        carConfigs = data;
        for (int i = 0; i < carConfigs.size(); i++) {
            MyTableView myTableView = new MyTableView(this);
            myTableView.initData(carConfigs.get(i), i);
            llCarConfigContent.addView(myTableView);

            MyTableView myTableViewLeft = new MyTableView(this);
            ArrayList<String> list = new ArrayList<>();
            list.add(carConfigs.get(i).get(0));
            myTableViewLeft.initData(list, i);
            llCarConfigContentLeft.addView(myTableViewLeft);
            if (i == 0) {
                myTableViewLeft.setFirstOnClickListener(this);
                myTableView.setFirstOnClickListener(this);

                if (carConfigs != null) {
                    myTableViewTop.initData(carConfigs.get(0), 0);
                    ArrayList<String> listTop = new ArrayList<>();
                    listTop.add(carConfigs.get(0).get(0));
                    myTableViewTopLeft.initData(listTop, 0);
                }
            }
        }
    }

    @Override
    public boolean isALl() {
        return allCarConfig;
    }

    public void setCarInfo(SellCarProgramEntity carInfo) {
        tvCarType.setText(carInfo.getModelName());
        int sellprice = (int) (carInfo.getSellPrice() * 10000);
        if (sellprice >= 10000) {
            tvCarPrice.setText("总价：￥" + Utils.formatInt(carInfo.getSellPrice() + "") + "万元");
        } else {
            tvCarPrice.setText("总价：￥" + Utils.formatString(sellprice) + "元");
        }
        if (sellprice * firstScal >= 10000) {
            NumAnim.startAnim(tvFirstSell, Float.valueOf(Utils.formatInt("" + (float) (sellprice * firstScal / 10000))));
            tvFirstSellWy.setVisibility(View.VISIBLE);
        } else {
            NumAnim.startAnim(tvFirstSell, Float.valueOf(Utils.formatInt("" + (int) (sellprice * firstScal))));
            tvFirstSellWy.setVisibility(View.GONE);
        }
        float monthMoney = (float) (sellprice * (1 - firstScal) / monthNumber);
        if (monthMoney >= 10000) {
            NumAnim.startAnim(tvMonthSell, Float.valueOf(Utils.formatInt("" + (float) (monthMoney / 10000))));
            tvMonthSellWy.setVisibility(View.VISIBLE);
        } else {
            NumAnim.startAnim(tvMonthSell, Float.valueOf(Utils.formatInt("" + (int) monthMoney)));
            tvMonthSellWy.setVisibility(View.GONE);
        }
        int changePriceLast = (int) ((myCarSellPrice - sellprice * firstScal));//置换金额余额
        if (changePriceLast < 0) {
            changePriceLast = 0;
        }
        if (changePriceLast >= 10000) {
            NumAnim.startAnim(tvMyCarSellPrice, Float.valueOf(Utils.formatInt("" + (float) changePriceLast / 10000)));
            tvMyCarSellPriceWy.setVisibility(View.VISIBLE);
        } else {
            NumAnim.startAnim(tvMyCarSellPrice, Float.valueOf(Utils.formatInt("" + changePriceLast)));
            tvMyCarSellPriceWy.setVisibility(View.GONE);
        }
        if (myCarSellPrice >= 10000) {
            tvChangePriceAll.setText("置换总金额：" + Utils.formatInt(myCarSellPrice / 10000 + "") + "万元");//置换总金额
        } else {
            tvChangePriceAll.setText("置换总金额：" + Utils.formatInt(myCarSellPrice + "") + "万元");//置换总金额
        }
        float needPayMoney = (int) (sellprice * firstScal - myCarSellPrice);//置换金邸首付后需要支付的
        if (needPayMoney >= 10000) {
            needPayMoney = needPayMoney / 10000;
            tvChangePriceWy.setVisibility(View.VISIBLE);
        }else {
            tvChangePriceWy.setVisibility(View.GONE);
        }
        String tvChangePriceValue = needPayMoney > 0 ? needPayMoney + "" : "0";
        NumAnim.startAnim(tvChangePrice, Float.valueOf(tvChangePriceValue));
    }


    @Override
    public void onFirstClick() {
        if (sellCarProgramEntityList.size() == 1) {
            showMessage("无差异项");
            return;
        }
        allCarConfig = !allCarConfig;
        llCarConfigContentLeft.removeAllViews();
        llCarConfigContent.removeAllViews();
        presenter.getVehicleModelParams(getWContext().get());
    }
}
